package com.gua.otap.controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;

import com.gua.framework.controller.BaseController;
import com.gua.otap.bean.RegistrationBean;
import com.gua.otap.service.RegistrationService;

/**
 * 
 * @author Piyush
 * Controller for user registration
 *
 */
public class RegistrationController extends BaseController{
	
	private RegistrationService registrationService;
	
	public void setRegistrationService(RegistrationService registrationService) {
		this.registrationService = registrationService;
	}

	protected Object formBackingObject(HttpServletRequest request)
			throws ServletException {
		RegistrationBean registrationBean = new RegistrationBean();
		return registrationBean;
	}

	protected ModelAndView onSubmit(HttpServletRequest request,
			HttpServletResponse response, Object command,
			BindException exception) throws ServletException {
		RegistrationBean registrationBean = (RegistrationBean)command;
		// Get the fields from request
		
		// call the service layer
		//registrationService.yourMethod(Pass your bean here);
		return null;
	}
	

}
